/**
 *
 * 医疗服务指标点击模块
 * @Date: 2016-1-25
 * @author: Jackson wang
 * @version: 1.0
 * @since: 1.0
 *
 */
 
 define(["jquery","sysmanMain","valueUtil","satisfactionWindowHisInfo","satisEvaluateInfo","inpatientDeptInfo","inpatientQuestionInfo"],
		function($,sysmanMain,valueUtil,satisfactionWindowHisInfo,satisEvaluateInfo,inpatientDeptInfo,inpatientQuestionInfo) {
	
			
	var config = {
		//dom根节点
		rootid : 'panel-chart-all div.medical-panel',
		
		//事件dom选择器
		selector: 'a.medical-indicate'		
		
	}	
	
	var public_method = {
		
		/**
		 * @param _options.evt	事件对象
		 * @param _options.yearAndMonth	统计年月
		 */
		openPage:function(_options){
			if(window.console){
				console.info('satisfactionIndicate loaded and running ...')
			}
			var e = _options.evt
			if(e && e.currentTarget){
				var _t = e.currentTarget
				var _c = $(_t).attr('indicate');
				
				var oc = {
					monitor_year_month:_options.yearAndMonth
				}
				
				
				if(_c){
					switch(_c){
						case 'satisfied-window-num':
						//门诊窗口评价数量
						private_method.openSatisfactionWindowHisInfo(oc);
						break;
						
						case 'outinpatient-problem-num':
						//门诊问卷评价数量
						//设置过滤条件
						var _p = $.extend({},oc,{type:1});
						private_method.openOutpatientProblemInfo(_p);
						break;
						
						case 'inpatient-dept-num':
						//住院科室评价数量
						var _p = $.extend({},oc,{evaluate_type:2});						
						private_method.openInpatientDeptInfo(_p);
						break;
						
						case 'inpatient-problem-num':
						//住院问卷评价数量
						var _p = $.extend({},oc,{evaluate_type:2});
						private_method.openInpatientProblemInfo(_p);						
						break;
						
						
						case 'window-percent':
						//门诊窗口满意率						
						private_method.openSatisfactionWindowHisInfo(oc);
						
						break;
						case 'outinpatient-problem-percent':
						//门诊问卷满意率
						var _p = $.extend({},oc,{type:1});
						private_method.openOutpatientProblemInfo(_p);
						break;
						case 'inpatient-dept-percent':
						//住院科室满意率率
						var _p = $.extend({},oc,{evaluate_type:2});						
						private_method.openInpatientDeptInfo(_p);
						break;
						
						case 'inpatient-problem-percent':
						//住院问卷满意率
						var _p = $.extend({},oc,{evaluate_type:2});
						private_method.openInpatientProblemInfo(_p);
						break;
						
						default:
						private_method.openSatisfactionWindowHisInfo(oc);
					}
				}
			}
		}
	}
	
	var private_method = {
		//门诊窗口满意度
		openSatisfactionWindowHisInfo:function(_options){
			satisfactionWindowHisInfo.openPage(_options)
		}
		,
		//门诊问卷满意度
		openOutpatientProblemInfo:function(_options){
			satisEvaluateInfo.openPage(_options)
		}
		,
		//住院科室满意度
		openInpatientDeptInfo:function(_options){
			inpatientDeptInfo.openPage(_options)
		}
		,
		//住院问卷满意度
		openInpatientProblemInfo:function(_options){
			inpatientQuestionInfo.openPage(_options)
		}
	}
	return public_method;
})